<template>
	<!-- 头部导航栏 -->
	<view style="width: 100%;border-bottom: solid 1rpx #eee;display: flex;justify-content:space-between;align-items: center;padding: 28rpx 20rpx;position:fixed;top:0;left:0;right:0;height: 60px;z-index: 22;background-color: white;">
		<view style="position: absolute;z-index: 22;display: flex;" @click="back">
			<u-icon name="arrow-left"></u-icon>
			<view>返回</view>
		</view>
		
		<view style="font-weight: bold;position: absolute;left: 0;right: 0;height: 100%;display: flex;align-items: center;justify-content: center;">
			图文预览
		</view>
		 
<!-- 		<view style="">
			<view style="margin-left: 10rpx;display: flex;align-items: center;;padding: 10rpx 25rpx;margin: 0 10rpx;border-radius: 10rpx;box-shadow: 0 0 14px 0 #66666635;border: solid 1rpx #ddd;">
				开始发布
			</view>
		</view> -->
	</view>
	
	<view style="padding-top: 60px;"></view>
	
	<view v-if="post" style="margin: 0 10rpx;box-sizing: border-box;">
		
		<view style="padding: 20px;">
			<view style="font-weight: bold;font-size: 16px;">{{post.title}}</view>
			<view style="padding-top: 10px;display: flex;align-items: center;">
				<view style="font-weight: bold;color: #888;">掌聘Job</view>
				<view style="margin-left: 10px;color: #999;"> 2023-10-21 15:04</view>
			</view>
		</view>	
		
<!-- 		<view  style="height: 150px;overflow: hidden;display: flex;align-items: center;position: relative;">
			<image style="width: 100%;" mode="widthFix" :src="absUrl(post.thumb_url)"></image>
		</view> -->
		
		<mp-html :content="html2" :tag-style="{boxSizing:'border-box'}" style="box-sizing: border-box;" />
		<!-- <web-view :webview-styles="{with:'100%'}" fullscreen src="http://www.apesk.net/api/common/wx/get_published"></web-view> -->
	</view>
	
	<view v-if="noExist" style="display: flex;justify-content: center;padding-top: 60px;">
		<view style="display: flex;">
			<u-icon name="info-circle-fill" color="#23c2ee"></u-icon>
			<view style="padding-left: 5px;">文章已经不存在</view>
		</view>
	</view>
	
</template>
 
<script>
	export default {
		computed:{
			 
		},
		async onLoad(options){
			console.log(options)

			var res = await this.$http.get(`/common/wx/post?id=${options.id}`)
			
			if(!res.data)
			{
				this.$nextTick(()=>{
					this.noExist = true
				})
				
				return
			}
			
			this.post = res.data
			this.html2 = res.data.html
		},
		data() {
			return {
				html2:'',
				post:null,
				noExist:false
			}
		},
		methods: {
			back(){
				uni.navigateBack()
			}
		}
	}
</script>

<style scoped>
	/deep/ div {
		box-sizing: border-box;
	}
</style>
